package edu.pku.sei.modeler.uml.obsolete.fromdiagram;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;


public class ClassDiagramCommonPreferenceConstants extends
		CommonPreferenceConstants {
	// Class	
	/**
	 * The Constant P_CLASS_BACKGROUNDCOLOR.
	 */
	public static final String P_CLASS_BACKGROUNDCOLOR = "ClassDiagramPreferenceConstants.Class.backGroundColor";
	
	
	/**
	 * The Constant P_CLASS_BORDERCOLOR.
	 */
	public static final String P_CLASS_BORDERCOLOR = "ClassDiagramPreferenceConstants.Class.borderColor";
	
	
	/**
	 * The Constant P_CLASS_FONTCOLOR.
	 */
	public static final String P_CLASS_FONTCOLOR = "ClassDiagramPreferenceConstants.Class.fontColor";
	
	
	/**
	 * The Constant P_CLASS_FONT.
	 */
	public static final String P_CLASS_FONT = "ClassDiagramPreferenceConstants.Class.font";
	

	// Property	
	/**
	 * The Constant P_PROPERTY_BACKGROUNDCOLOR.
	 */
	public static final String P_PROPERTY_BACKGROUNDCOLOR = "ClassDiagramPreferenceConstants.Property.backGroundColor";
	
	/**
	 * The Constant P_PROPERTY_BORDERCOLOR.
	 */
	public static final String P_PROPERTY_BORDERCOLOR = "ClassDiagramPreferenceConstants.Property.borderColor";
	
	/**
	 * The Constant P_PROPERTY_FONTCOLOR.
	 */
	public static final String P_PROPERTY_FONTCOLOR = "ClassDiagramPreferenceConstants.Property.fontColor";
	
	
	/**
	 * The Constant P_PROPERTY_FONT.
	 */
	public static final String P_PROPERTY_FONT = "ClassDiagramPreferenceConstants.Property.font";
	
	/**
	 * The Constant P_PROPERTY_VISIBILITY.
	 */
	public static final String P_PROPERTY_VISIBILITY = "ClassDiagramPreferenceConstants.Property.visibility";
	
	/**
	 * The Constant P_PROPERTY_ISDERIVED.
	 */
	public static final String P_PROPERTY_ISDERIVED = "ClassDiagramPreferenceConstants.Property.iSderived";
	
	/**
	 * The Constant P_PROPERTY_NAME.
	 */
	public static final String P_PROPERTY_NAME = "ClassDiagramPreferenceConstants.Property.name";
	
	/**
	 * The Constant P_PROPERTY_TYPE.
	 */
	public static final String P_PROPERTY_TYPE = "ClassDiagramPreferenceConstants.Property.type";
	
	/**
	 * The Constant P_PROPERTY_MULTIPLICITY.
	 */
	public static final String P_PROPERTY_MULTIPLICITY = "ClassDiagramPreferenceConstants.Property.mutliplicity";
	/**
	 * The Constant P_PROPERTY_DEFAULT_VALUE.
	 */
	public static final String P_PROPERTY_DEFAULT_VALUE= "ClassDiagramPreferenceConstants.Property.defaultValue";
	
	/**
	 * The Constant P_PROPERTY_MODIFIERS.
	 */
	public static final String P_PROPERTY_MODIFIERS = "ClassDiagramPreferenceConstants.Property.modifiers";
	
	// Operation	
	/**
	 * The Constant P_OPERATION_BACKGROUNDCOLOR.
	 */
	public static final String P_OPERATION_BACKGROUNDCOLOR = "ClassDiagramPreferenceConstants.Operation.backGroundColor";
	
	
	/**
	 * The Constant P_OPERATION_BORDERCOLOR.
	 */
	public static final String P_OPERATION_BORDERCOLOR = "ClassDiagramPreferenceConstants.Operation.borderColor";
	
	
	/**
	 * The Constant P_OPERATION_FONTCOLOR.
	 */
	public static final String P_OPERATION_FONTCOLOR = "ClassDiagramPreferenceConstants.Operation.fontColor";
	
	
	/**
	 * The Constant P_OPERATION_FONT.
	 */
	public static final String P_OPERATION_FONT = "ClassDiagramPreferenceConstants.Operation.font";


	/** Constant for operation display (operation name) */
	public static final String P_OPERATION_DISPLAY_NAME = "ClassDiagramPreferenceConstants.Operation.display.Name";

	/** Constant for operation display (operation visibility) */
	public static final String P_OPERATION_DISPLAY_VISIBILITY = "ClassDiagramPreferenceConstants.Operation.display.Visibility";

	/** Constant for operation display (operation modifiers) */
	public static final String P_OPERATION_DISPLAY_MODIFIERS = "ClassDiagramPreferenceConstants.Operation.display.Modifiers";

	/** Constant for operation display (parameter direction) */
	public static final String P_OPERATION_DISPLAY_PARAMETER_DIRECTION = "ClassDiagramPreferenceConstants.Operation.display.ParameterDirection";

	/** Constant for operation display (parameter name) */
	public static final String P_OPERATION_DISPLAY_PARAMETER_NAME = "ClassDiagramPreferenceConstants.Operation.display.ParameterName";
	
	/** Constant for operation display (parameter type) */
	public static final String P_OPERATION_DISPLAY_PARAMETER_TYPE = "ClassDiagramPreferenceConstants.Operation.display.ParameterType";
	
	/** Constant for operation display (parameter multiplicity) */
	public static final String P_OPERATION_DISPLAY_PARAMETER_MULTIPLICITY = "ClassDiagramPreferenceConstants.Operation.display.ParameterMultiplicity";
	
	/** Constant for operation display (parameter default value) */
	public static final String P_OPERATION_DISPLAY_PARAMETER_DEFAULT = "ClassDiagramPreferenceConstants.Operation.display.ParameterDefault";
	
	/** Constant for operation display (parameter modifiers) */
	public static final String P_OPERATION_DISPLAY_PARAMETER_MODIFIERS = "ClassDiagramPreferenceConstants.Operation.display.ParameterModifiers";
	
	/** Constant for operation display (parameter modifiers) */
	public static final String P_OPERATION_DISPLAY_RT_TYPE = "ClassDiagramPreferenceConstants.Operation.display.ReturnParameterType";
	
	/** Constant for operation display (parameter modifiers) */
	public static final String P_OPERATION_DISPLAY_RT_MULTIPLICITY = "ClassDiagramPreferenceConstants.Operation.display.ReturnParameterMultiplicity";
	

	
	/**
	 * Gets the preference class background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class background color
	 */
	public static RGB getPreferenceClassBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CLASS_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference class border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class border color
	 */
	public static RGB getPreferenceClassBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CLASS_BORDERCOLOR);
	}
		
	/**
	 * Gets the preference class font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class font color
	 */
	public static RGB getPreferenceClassFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CLASS_FONTCOLOR);
	}
	
	/**
	 * Gets the preference class font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class font
	 */
	public static FontData[] getPreferenceClassFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_CLASS_FONT);
	}
	
	
	/**
	 * Gets the preference property background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference property background color
	 */
	public static RGB getPreferencePropertyBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PROPERTY_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference property border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference property border color
	 */
	public static RGB getPreferencePropertyBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PROPERTY_BORDERCOLOR);
	}
		
	/**
	 * Gets the preference property font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference property font color
	 */
	public static RGB getPreferencePropertyFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PROPERTY_FONTCOLOR);
	}
	
	/**
	 * Gets the preference property font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference property font
	 */
	public static FontData[] getPreferencePropertyFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_PROPERTY_FONT);
	}
	
	/**
	 * Gets the preference operation background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference operation background color
	 */
	public static RGB getPreferenceOperationBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_OPERATION_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference operation border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference operation border color
	 */
	public static RGB getPreferenceOperationBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_OPERATION_BORDERCOLOR);
	}
		
	/**
	 * Gets the preference operation font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference operation font color
	 */
	public static RGB getPreferenceOperationFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_OPERATION_FONTCOLOR);
	}
	
	/**
	 * Gets the preference operation font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference operation font
	 */
	public static FontData[] getPreferenceOperationFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_OPERATION_FONT);
	}
	
	/**
	 * Gets the preference for appearance (display Name in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the name must be displayed
	 */
	public static boolean getPreferenceOperationNameAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_NAME);
	}
	
	/**
	 * Gets the preference for appearance (display visibility in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the visibility must be displayed
	 */
	public static boolean getPreferenceOperationVisibilityAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_VISIBILITY);
	}
	
	/**
	 * Gets the preference for appearance (display return parameter type in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the return parameter's type must be displayed
	 */
	public static boolean getPreferenceOperationRTTypeAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_RT_TYPE);
	}
	
	/**
	 * Gets the preference for appearance (display return parameter multiplicity in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the return parameter's type must be displayed
	 */
	public static boolean getPreferenceOperationRTMultiplicityAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_RT_MULTIPLICITY);
	}
	
	/**
	 * Gets the preference for appearance (display parameter direction in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the parameter's direction must be displayed
	 */
	public static boolean getPreferenceOperationParameterDirectionAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_PARAMETER_DIRECTION);
	}
	
	/**
	 * Gets the preference for appearance (display parameter name in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the parameter's name must be displayed
	 */
	public static boolean getPreferenceOperationParameterNameAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_PARAMETER_NAME);
	}
	
	/**
	 * Gets the preference for appearance (display parameter type in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the parameter's type must be displayed
	 */
	public static boolean getPreferenceOperationParameterTypeAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_PARAMETER_TYPE);
	}
	
	/**
	 * Gets the preference for appearance (display parameter multiplicity in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the parameter's multiplicity must be displayed
	 */
	public static boolean getPreferenceOperationParameterMultiplicityAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_PARAMETER_MULTIPLICITY);
	}
	
	/**
	 * Gets the preference for appearance (display parameter default value in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the parameter's default value must be displayed
	 */
	public static boolean getPreferenceOperationParameterDefaultValueAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_PARAMETER_DEFAULT);
	}
	
	/**
	 * Gets the preference for appearance (display parameter modifiers in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the parameter's modifiers must be displayed
	 */
	public static boolean getPreferenceOperationParameterModifiersAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_PARAMETER_MODIFIERS);
	}
	
	/**
	 * Gets the preference for appearance (display modifiers in Operation Labels).
	 * @param store the store
	 * @return <code>true</code> if the modifiers must be displayed
	 */
	public static boolean getPreferenceOperationModifiersAppearance(IPreferenceStore store) {
		return store.getBoolean(P_OPERATION_DISPLAY_MODIFIERS);
	}
	

	
	/**
	 * Gets the preference visibility displaying for Properties.
	 * 
	 * @param store the store
	 * 
	 * @return the preference boolean for property visibility displaying
	 */
	public static boolean getPreferencePropertyVisibilityAppearance(IPreferenceStore store) {
		return store.getBoolean(P_PROPERTY_VISIBILITY);
	}

	/**
	 * Gets the preference isDerived displaying for Properties.
	 * 
	 * @param store the store
	 * 
	 * @return the preference boolean for property isDerived displaying
	 */
	public static boolean getPreferencePropertyIsDerivedAppearance(IPreferenceStore store) {
		return store.getBoolean(P_PROPERTY_ISDERIVED);
	}
	
	/**
	 * Gets the preference name displaying for Properties.
	 * 
	 * @param store the store
	 * 
	 * @return the preference boolean for property name displaying
	 */
	public static boolean getPreferencePropertyNameAppearance(IPreferenceStore store) {
		return store.getBoolean(P_PROPERTY_NAME);
	}
	
	/**
	 * Gets the preference type displaying for Properties.
	 * 
	 * @param store the store
	 * 
	 * @return the preference boolean for property type displaying
	 */
	public static boolean getPreferencePropertyTypeAppearance(IPreferenceStore store) {
		return store.getBoolean(P_PROPERTY_TYPE);
	}
	
	/**
	 * Gets the preference multiplicity displaying for Properties.
	 * 
	 * @param store the store
	 * 
	 * @return the preference boolean for property multiplicity displaying
	 */
	public static boolean getPreferencePropertyMultiplicityAppearance(IPreferenceStore store) {
		return store.getBoolean(P_PROPERTY_MULTIPLICITY);
	}
	
	/**
	 * Gets the preference default value displaying for Properties.
	 * 
	 * @param store the store
	 * 
	 * @return the preference boolean for property default value displaying
	 */
	public static boolean getPreferencePropertyDefaultValueAppearance(IPreferenceStore store) {
		return store.getBoolean(P_PROPERTY_DEFAULT_VALUE);
	}
	
	/**
	 * Gets the preference default value modifiers for Properties.
	 * 
	 * @param store the store
	 * 
	 * @return the preference boolean for property modifiers displaying
	 */
	public static boolean getPreferencePropertyModifiersAppearance(IPreferenceStore store) {
		return store.getBoolean(P_PROPERTY_MODIFIERS);
	}
	
	/**
	 * Sets the default preferences.
	 * 
	 * @param store the store
	 */
	public static void setDefaultPreferences(IPreferenceStore store) {

		// Class
//		PreferenceConverter.setDefault(store, P_CLASS_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
//		PreferenceConverter.setDefault(store, P_CLASS_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
//		PreferenceConverter.setDefault(store, P_CLASS_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_CLASS_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// Property
//		PreferenceConverter.setDefault(store, P_PROPERTY_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
//		PreferenceConverter.setDefault(store, P_PROPERTY_BORDERCOLOR,PreferenceConstants.getPapyrusColorGray());
//		PreferenceConverter.setDefault(store, P_PROPERTY_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_PROPERTY_FONT, new FontData("Arial", 10, SWT.BOLD));
		store.setDefault(P_PROPERTY_VISIBILITY, true);
		store.setDefault(P_PROPERTY_ISDERIVED, true);
		store.setDefault(P_PROPERTY_NAME, true);
		store.setDefault(P_PROPERTY_TYPE, true);
		store.setDefault(P_PROPERTY_DEFAULT_VALUE, true);
		store.setDefault(P_PROPERTY_MULTIPLICITY, true);
		store.setDefault(P_PROPERTY_MODIFIERS, true);
		
		// Operation
//		PreferenceConverter.setDefault(store, P_OPERATION_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
//		PreferenceConverter.setDefault(store, P_OPERATION_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
//		PreferenceConverter.setDefault(store, P_OPERATION_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_OPERATION_FONT, new FontData("Arial", 10, SWT.BOLD));
		store.setDefault(P_OPERATION_DISPLAY_NAME, true);
		store.setDefault(P_OPERATION_DISPLAY_VISIBILITY, true);
		store.setDefault(P_OPERATION_DISPLAY_MODIFIERS, false);
		store.setDefault(P_OPERATION_DISPLAY_PARAMETER_DIRECTION, true);
		store.setDefault(P_OPERATION_DISPLAY_PARAMETER_NAME, false);
		store.setDefault(P_OPERATION_DISPLAY_PARAMETER_TYPE, true);
		store.setDefault(P_OPERATION_DISPLAY_PARAMETER_MULTIPLICITY, false);
		store.setDefault(P_OPERATION_DISPLAY_PARAMETER_DEFAULT, false);
		store.setDefault(P_OPERATION_DISPLAY_PARAMETER_MODIFIERS, false);
		store.setDefault(P_OPERATION_DISPLAY_RT_TYPE, true);
		store.setDefault(P_OPERATION_DISPLAY_RT_MULTIPLICITY, false);
		
	}
}
